﻿
Imports System.Data
Imports System
Imports System.Collections.Generic

Partial Class Controls_wctlProyectoListar
    Inherits System.Web.UI.UserControl

    Protected Sub btnSeleccionarPersonal_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSeleccionarPersonal.Click
        Try
            If Not fuValidarDatosalSeleccionar() Then
                Exit Sub
            End If
            Dim lLst As List(Of Object) = dgvProyectos.GetSelectedFieldValues("prycodProyecto")
            Dim lsProyectoId As String = lLst.Item(0).ToString
            'Llenar el formulario
            Session("proyectoId") = lsProyectoId
            Response.Redirect("wfrmProyectoPersonalAsignar.aspx")

        Catch ex As Exception
            lblmensaje.Text = Err.Description
        End Try

    End Sub
    Function fuValidarDatosalSeleccionar() As Boolean
        Dim lbErr As Boolean
        Try
            lblmensaje.Text = ""
            If dgvProyectos.GetSelectedFieldValues("prycodProyecto").Count = 0 Then
                lblmensaje.Text &= "*Debe seleccionar un Personal de la lista </BR>"
                lbErr = True
            End If
            Return Not lbErr
        Catch ex As Exception
            lblmensaje.Text = Err.Description
        End Try
    End Function

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Response.Redirect("wfrmHoraRegistroListar.aspx")
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Response.Redirect("wfrmGastoRegistroListar.aspx")
    End Sub

    Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
        Response.Redirect("wfrmActividadListar.aspx")

    End Sub
End Class
